package org.lendoo.web.pojo.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.lendoo.web.annotation.JsonBoolean2Integer;

import java.util.Date;

/**
 * Cart的vo类
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "CartVo", description = "Cart的vo类")
public class CartVo {
    @ApiModelProperty(value = "主键", dataType = "Integer")
    private Integer id;

    @ApiModelProperty(value = "用户id", dataType = "Integer")
    private Integer userId;

    @ApiModelProperty(value = "商品id", dataType = "Integer")
    private Integer goodsId;

    @ApiModelProperty(value = "商品数量", dataType = "Integer")
    private Integer quantity;

    @ApiModelProperty(value = "是否被选中。1表示被选中，0表示未被选中", dataType = "Integer")
    @JsonDeserialize(using = JsonBoolean2Integer.class, as = Integer.class, contentAs = boolean.class)
    private Integer selected;

    @ApiModelProperty(value = "创建时间", dataType = "Date")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty(value = "更新时间", dataType = "Date")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    @ApiModelProperty(value = "页数", dataType = "Integer")
    private Integer pageNo;

    @ApiModelProperty(value = "每页数量", dataType = "Integer")
    private Integer pageSize;
}